<template>
  <tr>
    <td>{{index}}</td>
    <td>{{item.created_at}}</td>
    <td>{{item.height}}cm</td>
    <td>{{item.weight}}kg</td>
    <td>{{item.bmi}}</td>
    <td>
      <a @click="deleteItem(item.id)" href="javascript:void(0)">删除</a>
      <span>{{ testProvide }}</span>
    </td>
  </tr>
</template>

<script>
export default {
  name: "ListItemComponent",
  inject: ['testProvide'],
  props: {
    index: {
      type: Number,
    },
    item: {
      type: Object,
      required: true
    },
    deleteItem: {
      type: Function,
      default: () => console.log('ListItemComponent 删除======')
    }
  }
}
</script>
